import styles from './index.less'
import React from "react";
import {history} from 'umi'
import {Tag} from "@douyinfe/semi-ui";

const VideoItems = ({videoList}: any) => {
    const goVideDetail = (id: number) => {
        window.sessionStorage.setItem('videoId', String(id))
        history.push(`/prvideo-detail`)
    }
    return (
        <div className={styles.video_items_container}>
            {
                videoList.map((t:any) => {
                    return (
                        <div key={t.id} className={styles.items_container} onClick={() => {
                            goVideDetail(t.id)
                        }}>
                            <div className={styles.item_cover_content}>
                                <img className={styles.item_cover} src={t.cover} alt={t.name}/>
                            </div>
                            <div className={styles.item_info}>
                                <p className={styles.item_name}>
                                    {t.videoName}
                                    <Tag style={{marginLeft: '8px'}} color='blue'> {t.isMovies? '电影' : '电视剧'}</Tag>
                                </p>
                                <p className={styles.item_describe}>  {t.shortDescribe}</p>
                            </div>
                        </div>
                    )
                })
            }
        </div>
    )
}

export default VideoItems
